import ZhengJu
editor = ZhengJu.Editor()
i=0
count = 0
for l in file ("google_annotated_uniq.txt"):
	ll = unicode(l,"utf8")
	p = (ll).split(u"\t")
	#~ print p[0]
	if len(p[0])==1:
		count += 1
		i += int(p[2])
	#~ try:
		#~ editor.reverse(p[0])
		#~ pinyin = "'".join (map (str, editor.wordlist))
		#~ print (p[0] + "\t" + pinyin + "\t" + p[1]).encode ("utf-8"),
	#~ except:
		#~ pass
print i,count

#~ for l in file ("google.txt"):
	#~ ll = unicode(l,"utf8")
	#~ p = (ll).split(u"\t")
	#~ print p[0]
	#~ if len(p[0])==1:
		#~ count += 1
		#~ i += int(p[1])
		#~ print p[0].encode ("utf-8")
	#~ try:
		#~ editor.reverse(p[0])
		#~ pinyin = "'".join (map (str, editor.wordlist))
		#~ print (p[0] + "\t" + pinyin + "\t" + p[1]).encode ("utf-8"),
	#~ except:
		#~ pass
#~ print i,count

import sets as Set
i=0
count = 0
s = Set.Set()
for l in file ("google_annotated.txt"):
	ll = unicode(l,"utf8")
	p = (ll).split(u"\t")
	if p[0] not in s:
		s.add(p[0])
		print ll.encode ("utf-8"),
		
